home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1991 / Jan 91 / MacApp.Tech$ 1⁄11⁄91 / 2596-Floating windows bug-Jan91 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.7 KB  |  87 lines  |  [TEXT/GEOL]

  1. Item    9473971                         7-Jan-91        10:33PST
  2.  
  3. From:   D3861                           Electronics for Imaging,Avi Bar,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. ------------------------------------------------------------------------------
  8.  
  9. Sub:    Floating windows bug fixes
  10.  
  11. Here are fixes for some subtle bugs in the MacApp floating windows package.
  12.  
  13. ----
  14.  
  15. 1.  Menus not enabled correctly after resume event in MultiFinder.
  16.  
  17. Status: happens sometimes; reported to Apple
  18.  
  19. Reason:  It appears that as a result of the showing of floating windows on a
  20. resume event, the target chain is sometimes not set to the proper non-floating
  21. active window.  Thus, the DoSetupMenus method does not go through the right
  22. target chain, and the active window does not get a chance to enable its menus.
  23.  
  24. Fix:  (suggested by Chris Muir, EFI)
  25. Save the target on a suspend event and restore it on a resume event.
  26.  
  27. In TApplication (or subclass) add a field:
  28.  
  29.     fSavedTarget: TEvtHandler;
  30.  
  31. In TApplication.IApplication (or override) add this line:
  32.  
  33.   fSavedTarget := self;
  34.  
  35. In TApplication.AboutToLoseControl (or override) add this line at the end:
  36.  
  37.   fSavedTarget := gTarget;
  38.  
  39. In TApplication.Regain Control (or override) add these two lines at the end:
  40.  
  41.   if gTarget <> fSavedTarget then
  42.    SetTarget(fSavedTarget);
  43.  
  44. Note:  In THINK Pascal, due to as yet unresolved floating windows bugs, it is
  45. wise to put all floating-windows-related changes inside {$IFC qFloaters}.  In
  46. compile options, put "qFloaters = 1;" for standalone application projects, but
  47. put "qFloaters = 0;" for projects to be run under the LightsBug environment.
  48.  
  49. ----
  50.  
  51. 2.  With a floating window present, the wrong document name will appear in
  52. LaserWriter status indicators such as PrintMonitor.
  53.  
  54. Status: replicable
  55.  
  56. Reason: MacApp sets the print dialog (cancel window) title to the title of the
  57. document window being printed -- BUT it doesn't then call PrValidate so the
  58. name will be noticed.  (See Tech Note #149.)  PrValidate is called before the
  59. cancel window appears, so it uses the title of the front window, which may be a
  60. floating window instead of the document window.
  61.  
  62. Fix:  Do another PrValidate so the title will be noticed, calling it after the
  63. cancel window appears.
  64.  
  65. If you have a subclass of TStdPrintHandler, add this override method:
  66.  
  67.  procedure TSubclassPrintHandler.PosePrintDialog;
  68.   override;
  69.  begin
  70.   inherited PosePrintDialog;
  71.   if PrValidate(THPrint(fHPrint)) then
  72.    ;
  73.  end;
  74.  
  75. If you would rather modify MacApp, simply add these lines to the end of
  76. TStdPrintHandler.PosePrintDialog:
  77.  
  78.   if PrValidate(THPrint(fHPrint)) then
  79.    ;
  80.  
  81. ----
  82.  
  83. Submitted for your approval,
  84. Tim Maroney,
  85. Electronics for Imaging
  86.  
  87.